package org.vectrics.recruiter.struts.admin;

import javax.servlet.jsp.JspException;

import org.vectrics.hibernate.ThreadProperties;
import org.vectrics.recruiter.RecruitServiceLocator;
import org.vectrics.recruiter.job.CandidateScanCriteria;
import org.vectrics.recruiter.job.Job;
import org.vectrics.recruiter.struts.CandidateScanForm;
import org.vectrics.struts.VectricsActionData;
import org.vectrics.struts.VectricsStrutsAction;

/**
 * @author MMoore
 */
public class CandidateScanAction extends VectricsStrutsAction {
	public static final long serialVersionUID = 76809823533455L;

	protected String doExecute(VectricsActionData actionData)
			throws JspException {
		String forward = "success";
		CandidateScanForm candidateScanForm = (CandidateScanForm)actionData.getForm();
		Long jobId = new Long(candidateScanForm.getJobId());
		Job job = RecruitServiceLocator.getJobProvider().findJob(jobId);
		CandidateScanCriteria candidateCriteria = new CandidateScanCriteria(ThreadProperties.getDomain());
		RecruitServiceLocator.getJobProvider().findCandidates(candidateCriteria, 0, 100);
		
		
		return(forward);
	}

}
